package Expe9;

/**
 * @Author 28021
 * @Date 2022/10/25
 */
public class Animal {
    public int  Age;
    Animal(){}
    Animal(int Age){
        this.Age=Age;
    }
}
class Bird extends Animal{
    public String color;
    public Bird(String color,int age) {
        super(age);
        this.color=color;
    }
    void printInfo(){
        System.out.println("我是一只"+color+"的鸟");
        System.out.println("我今年"+Age+"岁了！");
    }
//    public String getColor() {
//        return color;
//    }
//    public void setColor(String color) {
//        this.color = color;
//    }
}
class Fish extends Animal{
    int weight;
    public Fish(int weight,int age){
        super(age);
        this.weight=weight;
    }
    void printInfo(){
        System.out.println("我是一只"+weight+"斤重的鱼");
        System.out.println("我今年"+Age+"岁了！");
    }
//    public double getWeight() {
//        return weight;
//    }
//    public void setWeight(double weight) {
//        this.weight = weight;
//    }
}
class T{
    public static void main(String[] args) {
        Bird b = new Bird("红色",4);
        b.printInfo();
        Fish f=new Fish(5,2);
        f.printInfo();
    }
}